﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Messsagebox;

namespace haunstm_test_windows_forms
{
    public partial class frmUnmodalMessagebox : Form
    {
        public frmUnmodalMessagebox()
        {
            InitializeComponent();

        }

        private bool toggle;

        private void ToggleTickerColor()
        {
            while (true)
            {
                if (toggle)
                {
                    lblTicker.BackColor = Color.Blue;
                }
                else
                {
                    lblTicker.BackColor = Color.Red;
                }
                toggle = !toggle;
                System.Threading.Thread.Sleep(300);
            }

        }
        
        private void btnUnmodalMessagebox_Click(object sender, EventArgs e)
        {
            UnmodalMessagebox.Show("Unmodal textbox test!", "Unmodal");
        }

        private void btnModalMessagebox_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Unmodal textbox test!", "Modal");
        }



        private void tmrToggle_Tick(object sender, EventArgs e)
        {

        }

        private void frmUnmodalMessagebox_Load(object sender, EventArgs e)
        {

        }

        private void btnStartTick_Click(object sender, EventArgs e)
        {
            ToggleTickerColor();
        }


    }
}
